home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / game / shoot / ADoomPPC_src.lha / ADoomPPC_src / d_player.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  4.8 KB  |  217 lines

  1. // Emacs style mode select   -*- C++ -*- 
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. //
  19. //
  20. //-----------------------------------------------------------------------------
  21.  
  22.  
  23. #ifndef __D_PLAYER__
  24. #define __D_PLAYER__
  25.  
  26.  
  27. // The player data structure depends on a number
  28. // of other structs: items (internal inventory),
  29. // animation states (closely tied to the sprites
  30. // used to represent them, unfortunately).
  31. #include "d_items.h"
  32. #include "p_pspr.h"
  33.  
  34. // In addition, the player is just a special
  35. // case of the generic moving object/actor.
  36. #include "p_mobj.h"
  37.  
  38. // Finally, for odd reasons, the player input
  39. // is buffered within the player data struct,
  40. // as commands per game tick.
  41. #include "d_ticcmd.h"
  42.  
  43. #ifdef __GNUG__
  44. #pragma interface
  45. #endif
  46.  
  47. #ifdef __SASC
  48. #pragma options align=mac68k
  49. #endif
  50.  
  51. //
  52. // Player states.
  53. //
  54. typedef enum
  55. {
  56.     // Playing or camping.
  57.     PST_LIVE,
  58.     // Dead on the ground, view follows killer.
  59.     PST_DEAD,
  60.     // Ready to restart/respawn???
  61.     PST_REBORN        
  62. }  playerstate_t;
  63.  
  64. //
  65. // Player internal flags, for cheats and debug.
  66. //
  67. typedef enum
  68. {
  69.     // No clipping, walk through barriers.
  70.     CF_NOCLIP        = 1,
  71.     // No damage, no health loss.
  72.     CF_GODMODE        = 2,
  73.     // Not really a cheat, just a debug aid.
  74.     CF_NOMOMENTUM    = 4
  75. }  cheat_t;
  76.  
  77. //
  78. // Extended player object info: player_t
  79. //
  80. typedef struct player_s
  81. {
  82.     mobj_t  *        mo;
  83.     playerstate_t     playerstate;
  84.     ticcmd_t         cmd;
  85.  
  86.     // Determine POV,
  87.     //  including viewpoint bobbing during movement.
  88.     // Focal origin above r.z
  89.     fixed_t         viewz;
  90.     // Base height above floor for viewz.
  91.     fixed_t         viewheight;
  92.     // Bob/squat speed.
  93.     fixed_t              deltaviewheight;
  94.     // bounded/scaled total momentum.
  95.     fixed_t              bob;    
  96.  
  97.     // This is only used between levels,
  98.     // mo->health is used during levels.
  99.     int             health;    
  100.     int             armorpoints;
  101.     // Armor type is 0-2.
  102.     int             armortype;    
  103.  
  104.     // Power ups. invinc and invis are tic counters.
  105.     int             powers[NUMPOWERS];
  106.     boolean         cards[NUMCARDS];
  107.     boolean         backpack;
  108.     
  109.     // Frags, kills of other players.
  110.     int             frags[MAXPLAYERS];
  111.     weapontype_t     readyweapon;
  112.     
  113.     // Is wp_nochange if not changing.
  114.     weapontype_t     pendingweapon;
  115.  
  116.     boolean         weaponowned[NUMWEAPONS];
  117.     int             ammo[NUMAMMO];
  118.     int             maxammo[NUMAMMO];
  119.  
  120.     // True if button down last tic.
  121.     int             attackdown;
  122.     int             usedown;
  123.  
  124.     // Bit flags, for cheats and debug.
  125.     // See cheat_t, above.
  126.     int             cheats;        
  127.  
  128.     // Refired shots are less accurate.
  129.     int             refire;        
  130.  
  131.      // For intermission stats.
  132.     int             killcount;
  133.     int             itemcount;
  134.     int             secretcount;
  135.  
  136.     // Hint messages.
  137.     char  *        message;    
  138.     
  139.     // For screen flashing (red or bright).
  140.     int             damagecount;
  141.     int             bonuscount;
  142.  
  143.     // Who did damage (NULL for floors/ceilings).
  144.     mobj_t  *        attacker;
  145.     
  146.     // So gun flashes light up areas.
  147.     int             extralight;
  148.  
  149.     // Current PLAYPAL, ???
  150.     //  can be set to REDCOLORMAP for pain, etc.
  151.     int             fixedcolormap;
  152.  
  153.     // Player skin colorshift,
  154.     //  0-3 for which color to draw player.
  155.     int             colormap;    
  156.  
  157.     // Overlay view sprites (gun, etc).
  158.     pspdef_t         psprites[NUMPSPRITES];
  159.  
  160.     // True if secret level has been done.
  161.     boolean         didsecret;    
  162.  
  163. }  player_t;
  164.  
  165. //
  166. // INTERMISSION
  167. // Structure passed e.g. to WI_Start(wb)
  168. //
  169. typedef struct
  170. {
  171.     boolean     in;    // whether the player is in game
  172.     
  173.     // Player stats, kills, collected items etc.
  174.     int         skills;
  175.     int         sitems;
  176.     int         ssecret;
  177.     int         stime; 
  178.     int         frags[4];
  179.     int         score;    // current score on entry, modified on return
  180. }  wbplayerstruct_t;
  181.  
  182. typedef struct
  183. {
  184.     int         epsd;    // episode # (0-2)
  185.  
  186.     // if true, splash the secret level
  187.     boolean     didsecret;
  188.     
  189.     // previous and next levels, origin 0
  190.     int         last;
  191.     int         next;    
  192.     
  193.     int         maxkills;
  194.     int         maxitems;
  195.     int         maxsecret;
  196.     int         maxfrags;
  197.  
  198.     // the par time
  199.     int         partime;
  200.     
  201.     // index of this player in game
  202.     int         pnum;    
  203.  
  204.     wbplayerstruct_t     plyr[MAXPLAYERS];
  205. }  wbstartstruct_t;
  206.  
  207. #ifdef __SASC
  208. #pragma options align=power
  209. #endif
  210.  
  211. #endif
  212. //-----------------------------------------------------------------------------
  213. //
  214. // $Log:$
  215. //
  216. //-----------------------------------------------------------------------------
  217.